from litemall_0805.frame.pages.home_page import HomePage
from litemall_0805.frame.utils.utils import repeat_click
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait


class AddCategoryPage(HomePage):

    def input_category_info(self, goods_name):
        self.do_send_keys(goods_name, By.CSS_SELECTOR, ".el-input__inner")
        WebDriverWait(self.driver, 5).until(repeat_click(By.XPATH, "//*[text()='确定']"))

        from litemall_0805.frame.pages.mall_manage.goods_category_list import GoodsCategoryList
        return GoodsCategoryList(self.driver)
